<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript 高级编程 - 学习页面 | StudyRaid</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --bg-primary: #0d1117;
            --bg-secondary: #161b22;
            --bg-tertiary: #21262d;
            --text-primary: #f0f6fc;
            --text-secondary: #c9d1d9;
            --text-tertiary: #8b949e;
            --border-color: #30363d;
            --accent-color: #58a6ff;
            --success-color: #3fb950;
            --warning-color: #d29922;
            --danger-color: #f85149;
            --border-radius: 6px;
            --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
        }

        body {
            background-color: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.5;
        }

        .container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* 导航栏样式 */
        header {
            background-color: var(--bg-secondary);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 0;
        }

        .logo {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
            text-decoration: none;
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--accent-color);
        }

        .nav-links {
            display: flex;
            gap: 24px;
        }

        .nav-links a {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 14px;
            transition: color 0.2s;
        }

        .nav-links a:hover,
        .nav-links a.active {
            color: var(--text-primary);
        }

        .user-menu {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .search-box {
            position: relative;
        }

        .search-box input {
            background-color: var(--bg-tertiary);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            padding: 8px 12px;
            padding-left: 32px;
            color: var(--text-primary);
            width: 240px;
            font-size: 14px;
        }

        .search-box i {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background-color: var(--accent-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            cursor: pointer;
        }

        /* 课程学习页面布局 */
        .course-learning-container {
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: 24px;
            margin: 24px 0;
        }

        /* 课程内容区域 */
        .course-content-area {
            background-color: var(--bg-secondary);
            border-radius: var(--border-radius);
            border: 1px solid var(--border-color);
            overflow: hidden;
        }

        .video-container {
            position: relative;
            width: 100%;
            background-color: #000;
            aspect-ratio: 16/9;
        }

        .video-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #1a1f2e, #0d1117);
        }

        .video-placeholder i {
            font-size: 64px;
            color: var(--accent-color);
            margin-bottom: 16px;
        }

        .video-placeholder p {
            color: var(--text-secondary);
            font-size: 18px;
        }

        .video-controls {
            display: flex;
            justify-content: space-between;
            padding: 16px;
            background-color: var(--bg-tertiary);
            border-top: 1px solid var(--border-color);
        }

        .video-info {
            padding: 20px;
        }

        .video-title {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .video-description {
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .video-navigation {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border-color);
        }

        .btn {
            padding: 10px 20px;
            border-radius: var(--border-radius);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
            text-align: center;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn-primary {
            background-color: var(--accent-color);
            color: white;
        }

        .btn-primary:hover {
            background-color: #4a93e0;
        }

        .btn-secondary {
            background-color: var(--bg-tertiary);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
        }

        .btn-secondary:hover {
            background-color: var(--bg-secondary);
        }

        /* 侧边栏 */
        .course-sidebar {
            background-color: var(--bg-secondary);
            border-radius: var(--border-radius);
            border: 1px solid var(--border-color);
            overflow: hidden;
            height: fit-content;
            position: sticky;
            top: 90px;
        }

        .sidebar-header {
            padding: 16px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sidebar-title {
            font-size: 18px;
            font-weight: 600;
        }

        .progress-container {
            padding: 16px;
            border-bottom: 1px solid var(--border-color);
        }

        .progress-info {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 14px;
        }

        .progress-bar {
            height: 6px;
            background-color: var(--bg-tertiary);
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background-color: var(--success-color);
            width: 65%;
        }

        .chapters-list {
            max-height: 500px;
            overflow-y: auto;
        }

        .chapter-item {
            border-bottom: 1px solid var(--border-color);
        }

        .chapter-item:last-child {
            border-bottom: none;
        }

        .chapter-header {
            padding: 12px 16px;
            background-color: var(--bg-tertiary);
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
        }

        .chapter-title {
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .lessons-list {
            display: none;
            background-color: var(--bg-primary);
        }

        .lessons-list.active {
            display: block;
        }

        .lesson-item {
            padding: 12px 16px 12px 32px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .lesson-item:hover {
            background-color: var(--bg-tertiary);
        }

        .lesson-item.active {
            background-color: var(--bg-tertiary);
            border-left: 3px solid var(--accent-color);
        }

        .lesson-item.completed .lesson-title {
            color: var(--success-color);
        }

        .lesson-item.completed .lesson-icon {
            color: var(--success-color);
        }

        .lesson-icon {
            width: 20px;
            text-align: center;
            color: var(--text-tertiary);
        }

        .lesson-title {
            flex: 1;
            font-size: 14px;
        }

        .lesson-duration {
            font-size: 12px;
            color: var(--text-tertiary);
        }

        /* 资源下载区域 */
        .resources-section {
            margin-top: 24px;
            background-color: var(--bg-secondary);
            border-radius: var(--border-radius);
            border: 1px solid var(--border-color);
            overflow: hidden;
        }

        .section-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            font-size: 18px;
            font-weight: 600;
        }

        .resources-list {
            padding: 16px 20px;
        }

        .resource-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-color);
        }

        .resource-item:last-child {
            border-bottom: none;
        }

        .resource-icon {
            width: 32px;
            height: 32px;
            background-color: var(--bg-tertiary);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent-color);
        }

        .resource-info {
            flex: 1;
        }

        .resource-name {
            font-weight: 500;
            margin-bottom: 4px;
        }

        .resource-size {
            font-size: 12px;
            color: var(--text-tertiary);
        }

        .download-btn {
            padding: 6px 12px;
            background-color: var(--bg-tertiary);
            border-radius: var(--border-radius);
            font-size: 12px;
            color: var(--text-primary);
            text-decoration: none;
            transition: background-color 0.2s;
        }

        .download-btn:hover {
            background-color: var(--accent-color);
        }

        /* 讨论区域 */
        .discussion-section {
            margin-top: 24px;
            background-color: var(--bg-secondary);
            border-radius: var(--border-radius);
            border: 1px solid var(--border-color);
            overflow: hidden;
        }

        .discussion-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .discussion-title {
            font-size: 18px;
            font-weight: 600;
        }

        .new-discussion-btn {
            padding: 8px 16px;
            background-color: var(--accent-color);
            color: white;
            border-radius: var(--border-radius);
            font-size: 14px;
            text-decoration: none;
        }

        .discussion-list {
            padding: 16px 20px;
        }

        .discussion-item {
            padding: 16px 0;
            border-bottom: 1px solid var(--border-color);
        }

        .discussion-item:last-child {
            border-bottom: none;
        }

        .discussion-author {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .author-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background-color: var(--accent-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: bold;
        }

        .author-name {
            font-weight: 500;
            font-size: 14px;
        }

        .discussion-time {
            font-size: 12px;
            color: var(--text-tertiary);
        }

        .discussion-content {
            color: var(--text-secondary);
            line-height: 1.5;
            margin-bottom: 8px;
        }

        .discussion-actions {
            display: flex;
            gap: 16px;
        }

        .discussion-action {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            color: var(--text-tertiary);
            cursor: pointer;
            transition: color 0.2s;
        }

        .discussion-action:hover {
            color: var(--text-secondary);
        }

        /* 页脚 */
        footer {
            border-top: 1px solid var(--border-color);
            padding: 24px 0;
            margin-top: 40px;
            text-align: center;
            color: var(--text-tertiary);
            font-size: 14px;
        }

        /* 响应式设计 */
        @media (max-width: 1024px) {
            .course-learning-container {
                grid-template-columns: 1fr;
            }

            .course-sidebar {
                order: -1;
                position: static;
            }
        }

        @media (max-width: 768px) {
            .navbar {
                flex-direction: column;
                gap: 16px;
            }

            .nav-links {
                order: 3;
                width: 100%;
                justify-content: center;
            }

            .search-box input {
                width: 200px;
            }

            .video-navigation {
                flex-direction: column;
                gap: 12px;
            }

            .video-navigation .btn {
                width: 100%;
                justify-content: center;
            }
        }
    </style>
</head>

<body>
    <!-- 导航栏 -->
    <header>
        <div class="container">
            <nav class="navbar">
                <a href="#" class="logo">
                    <i class="fas fa-graduation-cap"></i>
                    StudyRaid
                </a>

                <div class="nav-links">
                    <a href="my-courses.html">我的课程</a>
                    <a href="explore.html">发现</a>
                    <a href="learning-path.html">学习路径</a>
                    <a href="progress-tracking.html" class="active">进度追踪</a>
                </div>

                <div class="user-menu">
                    <div class="search-box">
                        <i class="fas fa-search"></i>
                        <input type="text" placeholder="搜索课程...">
                    </div>
                    <div class="user-avatar">JS</div>
                </div>
            </nav>
        </div>
    </header>

    <!-- 课程学习内容 -->
    <main class="container">
        <div class="course-learning-container">
            <!-- 主要内容区域 -->
            <div class="course-content-area">
                <!-- 视频播放区域 -->
                <div class="video-container">
                    <div class="video-placeholder">
                        <i class="fas fa-play-circle"></i>
                        <p>点击播放课程视频</p>
                    </div>
                </div>

                <div class="video-controls">
                    <button class="btn btn-secondary">
                        <i class="fas fa-fast-backward"></i> 上一节
                    </button>
                    <button class="btn btn-primary">
                        <i class="fas fa-play"></i> 播放视频
                    </button>
                    <button class="btn btn-secondary">
                        下一节 <i class="fas fa-fast-forward"></i>
                    </button>
                </div>

                <div class="video-info">
                    <h2 class="video-title">JavaScript 异步编程与Promise</h2>
                    <p class="video-description">
                        在本节课程中，我们将深入学习JavaScript中的异步编程概念，包括回调函数、Promise对象以及async/await语法。你将了解如何处理异步操作，避免回调地狱，并编写更加清晰和可维护的异步代码。
                    </p>

                    <div class="video-navigation">
                        <a href="#" class="btn btn-secondary">
                            <i class="far fa-bookmark"></i> 收藏本节
                        </a>
                        <a href="#" class="btn btn-primary">
                            <i class="fas fa-check"></i> 标记为已完成
                        </a>
                    </div>
                </div>
            </div>

            <!-- 侧边栏 -->
            <div class="course-sidebar">
                <div class="sidebar-header">
                    <h3 class="sidebar-title">课程内容</h3>
                    <span class="progress-text">65% 完成</span>
                </div>

                <div class="progress-container">
                    <div class="progress-info">
                        <span>进度</span>
                        <span>13/20 节课</span>
                    </div>
                    <div class="progress-bar">
                        <div class="progress-fill"></div>
                    </div>
                </div>

                <div class="chapters-list">
                    <!-- 章节 1 -->
                    <div class="chapter-item">
                        <div class="chapter-header">
                            <div class="chapter-title">
                                <i class="fas fa-chevron-down"></i>
                                <span>第一章: JavaScript基础</span>
                            </div>
                            <span>4/4</span>
                        </div>
                        <div class="lessons-list active">
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">JavaScript简介与历史</div>
                                <div class="lesson-duration">15:30</div>
                            </div>
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">变量与数据类型</div>
                                <div class="lesson-duration">22:10</div>
                            </div>
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">运算符与表达式</div>
                                <div class="lesson-duration">18:45</div>
                            </div>
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">控制流程与循环</div>
                                <div class="lesson-duration">25:20</div>
                            </div>
                        </div>
                    </div>

                    <!-- 章节 2 -->
                    <div class="chapter-item">
                        <div class="chapter-header">
                            <div class="chapter-title">
                                <i class="fas fa-chevron-down"></i>
                                <span>第二章: 函数与作用域</span>
                            </div>
                            <span>3/4</span>
                        </div>
                        <div class="lessons-list">
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">函数定义与调用</div>
                                <div class="lesson-duration">20:15</div>
                            </div>
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">作用域与闭包</div>
                                <div class="lesson-duration">28:30</div>
                            </div>
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">高阶函数</div>
                                <div class="lesson-duration">24:10</div>
                            </div>
                            <div class="lesson-item">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">递归与柯里化</div>
                                <div class="lesson-duration">19:45</div>
                            </div>
                        </div>
                    </div>

                    <!-- 章节 3 -->
                    <div class="chapter-item">
                        <div class="chapter-header">
                            <div class="chapter-title">
                                <i class="fas fa-chevron-down"></i>
                                <span>第三章: 面向对象编程</span>
                            </div>
                            <span>3/5</span>
                        </div>
                        <div class="lessons-list">
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">对象与原型</div>
                                <div class="lesson-duration">26:20</div>
                            </div>
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">构造函数与类</div>
                                <div class="lesson-duration">30:15</div>
                            </div>
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">继承与多态</div>
                                <div class="lesson-duration">22:40</div>
                            </div>
                            <div class="lesson-item">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">设计模式应用</div>
                                <div class="lesson-duration">35:10</div>
                            </div>
                            <div class="lesson-item">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">模块化开发</div>
                                <div class="lesson-duration">29:25</div>
                            </div>
                        </div>
                    </div>

                    <!-- 章节 4 -->
                    <div class="chapter-item">
                        <div class="chapter-header">
                            <div class="chapter-title">
                                <i class="fas fa-chevron-down"></i>
                                <span>第四章: 异步编程</span>
                            </div>
                            <span>3/7</span>
                        </div>
                        <div class="lessons-list">
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">异步编程基础</div>
                                <div class="lesson-duration">18:50</div>
                            </div>
                            <div class="lesson-item completed">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">回调函数与事件循环</div>
                                <div class="lesson-duration">32:15</div>
                            </div>
                            <div class="lesson-item active">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">Promise与异步操作</div>
                                <div class="lesson-duration">27:30</div>
                            </div>
                            <div class="lesson-item">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">Async/Await语法</div>
                                <div class="lesson-duration">24:45</div>
                            </div>
                            <div class="lesson-item">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">错误处理与调试</div>
                                <div class="lesson-duration">21:20</div>
                            </div>
                            <div class="lesson-item">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">并发与性能优化</div>
                                <div class="lesson-duration">29:10</div>
                            </div>
                            <div class="lesson-item">
                                <div class="lesson-icon"><i class="fas fa-play-circle"></i></div>
                                <div class="lesson-title">实战项目: 异步数据加载</div>
                                <div class="lesson-duration">45:00</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 资源下载区域 -->
        <div class="resources-section">
            <div class="section-header">课程资源</div>
            <div class="resources-list">
                <div class="resource-item">
                    <div class="resource-icon">
                        <i class="fas fa-file-pdf"></i>
                    </div>
                    <div class="resource-info">
                        <div class="resource-name">JavaScript异步编程指南.pdf</div>
                        <div class="resource-size">2.4 MB</div>
                    </div>
                    <a href="#" class="download-btn">下载</a>
                </div>
                <div class="resource-item">
                    <div class="resource-icon">
                        <i class="fas fa-file-code"></i>
                    </div>
                    <div class="resource-info">
                        <div class="resource-name">示例代码.zip</div>
                        <div class="resource-size">1.7 MB</div>
                    </div>
                    <a href="#" class="download-btn">下载</a>
                </div>
                <div class="resource-item">
                    <div class="resource-icon">
                        <i class="fas fa-file-alt"></i>
                    </div>
                    <div class="resource-info">
                        <div class="resource-name">练习题与答案.docx</div>
                        <div class="resource-size">856 KB</div>
                    </div>
                    <a href="#" class="download-btn">下载</a>
                </div>
            </div>
        </div>

        <!-- 讨论区域 -->
        <div class="discussion-section">
            <div class="discussion-header">
                <div class="discussion-title">课程讨论</div>
                <a href="#" class="new-discussion-btn">发起讨论</a>
            </div>
            <div class="discussion-list">
                <div class="discussion-item">
                    <div class="discussion-author">
                        <div class="author-avatar">MJ</div>
                        <div class="author-name">Michael Johnson</div>
                        <div class="discussion-time">2小时前</div>
                    </div>
                    <div class="discussion-content">
                        关于Promise链式调用中的错误处理，有没有更优雅的方式？我在实际项目中经常遇到多个异步操作需要依次执行，但错误处理变得很复杂。
                    </div>
                    <div class="discussion-actions">
                        <div class="discussion-action">
                            <i class="far fa-thumbs-up"></i> 12
                        </div>
                        <div class="discussion-action">
                            <i class="far fa-comment"></i> 回复
                        </div>
                    </div>
                </div>

                <div class="discussion-item">
                    <div class="discussion-author">
                        <div class="author-avatar">SR</div>
                        <div class="author-name">Sarah Rodriguez</div>
                        <div class="discussion-time">5小时前</div>
                    </div>
                    <div class="discussion-content">
                        老师讲解的async/await部分非常清晰！我之前一直对异步操作感到困惑，现在终于理解了。有没有推荐的实际项目来练习这些概念？
                    </div>
                    <div class="discussion-actions">
                        <div class="discussion-action">
                            <i class="far fa-thumbs-up"></i> 8
                        </div>
                        <div class="discussion-action">
                            <i class="far fa-comment"></i> 回复
                        </div>
                    </div>
                </div>

                <div class="discussion-item">
                    <div class="discussion-author">
                        <div class="author-avatar">DT</div>
                        <div class="author-name">David Thompson</div>
                        <div class="discussion-time">1天前</div>
                    </div>
                    <div class="discussion-content">
                        在视频中提到的"回调地狱"问题，我发现在使用Promise.all()时可以很好地解决多个并行异步操作的情况。大家在实际项目中还有什么其他技巧吗？
                    </div>
                    <div class="discussion-actions">
                        <div class="discussion-action">
                            <i class="far fa-thumbs-up"></i> 15
                        </div>
                        <div class="discussion-action">
                            <i class="far fa-comment"></i> 回复
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <p>© 2023 StudyRaid. 保留所有权利。</p>
            <p>采用 GitHub 深色风格设计</p>
        </div>
    </footer>

    <script>
        // 章节展开/折叠功能
        document.querySelectorAll('.chapter-header').forEach(header => {
            header.addEventListener('click', function () {
                const lessonsList = this.nextElementSibling;
                const icon = this.querySelector('i');

                if (lessonsList.classList.contains('active')) {
                    lessonsList.classList.remove('active');
                    icon.classList.remove('fa-chevron-down');
                    icon.classList.add('fa-chevron-right');
                } else {
                    lessonsList.classList.add('active');
                    icon.classList.remove('fa-chevron-right');
                    icon.classList.add('fa-chevron-down');
                }
            });
        });

        // 课程项点击功能
        document.querySelectorAll('.lesson-item').forEach(lesson => {
            lesson.addEventListener('click', function () {
                // 移除所有active类
                document.querySelectorAll('.lesson-item').forEach(item => {
                    item.classList.remove('active');
                });

                // 添加active类到当前项
                this.classList.add('active');

                // 更新视频标题和描述（模拟）
                const title = this.querySelector('.lesson-title').textContent;
                document.querySelector('.video-title').textContent = title;

                // 这里可以添加加载实际视频内容的逻辑
                console.log(`加载课程: ${title}`);
            });
        });

        // 播放按钮功能
        document.querySelector('.btn-primary').addEventListener('click', function () {
            const icon = this.querySelector('i');
            if (icon.classList.contains('fa-play')) {
                icon.classList.remove('fa-play');
                icon.classList.add('fa-pause');
                this.innerHTML = '<i class="fas fa-pause"></i> 暂停视频';
                // 这里可以添加实际播放视频的逻辑
            } else {
                icon.classList.remove('fa-pause');
                icon.classList.add('fa-play');
                this.innerHTML = '<i class="fas fa-play"></i> 播放视频';
                // 这里可以添加暂停视频的逻辑
            }
        });

        // 收藏功能
        document.querySelectorAll('.btn-secondary').forEach(button => {
            if (button.querySelector('.fa-bookmark')) {
                button.addEventListener('click', function () {
                    const icon = this.querySelector('i');
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        this.innerHTML = '<i class="fas fa-bookmark"></i> 已收藏';
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        this.innerHTML = '<i class="far fa-bookmark"></i> 收藏本节';
                    }
                });
            }
        });

        // 标记完成功能
        document.querySelector('.btn-primary:last-child').addEventListener('click', function () {
            const activeLesson = document.querySelector('.lesson-item.active');
            if (activeLesson && !activeLesson.classList.contains('completed')) {
                activeLesson.classList.add('completed');
                this.innerHTML = '<i class="fas fa-check-double"></i> 已完成';
                this.style.backgroundColor = 'var(--success-color)';

                // 更新进度
                const progressFill = document.querySelector('.progress-fill');
                const currentWidth = parseInt(progressFill.style.width);
                progressFill.style.width = (currentWidth + 5) + '%';

                // 更新进度文本
                const progressText = document.querySelector('.progress-text');
                const currentProgress = parseInt(progressText.textContent);
                progressText.textContent = (currentProgress + 5) + '% 完成';
            }
        });
    </script>
</body>

</html>